﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core
{
    public static partial class contest
    {
        public static dynamic getContestCompleteInfo(int cid)
        {
            var sql = new Sql.SqlDataContext();
            var result = sql.Contest.Where(row => row.cid == cid).FirstOrDefault();

            if (result == null)
                return new
                {
                    success = false,
                    msg = "比赛不存在"
                };
            return new
            {
                cid = result.cid,
                disabled = result.disabled,
                is_public = result.is_public,
                start_time = result.startTime,
                over_time = result.overTime,
                description = result.description
            };
        }
    }
}
